import 'babel-polyfill'
import Vue from 'vue'
import App from './App'
import router from './router'
import store from './store'
import { token, toast, toastClose, alertVux, logAgain, checkWrite } from './common/js/common'

import 'common/stylus/index.styl'
import 'common/css/common.css'  

Vue.prototype.$token = token
Vue.prototype.$toast = toast
Vue.prototype.$toastClose = toastClose
Vue.prototype.$alert = alertVux
Vue.prototype.$logAgain = logAgain
Vue.prototype.$checkWrite = checkWrite

window.addEventListener('load', function () {
    if(location.href.split('#')[1]!=='/recommend'){// 当前路径不为首页
        location.replace(location.href.split('#')[0])// 刷新时回到首页
    }
})

/* eslint-disable no-new */
new Vue({
    el: '#app',
    router,
    store, 
    render: h => h(App)
})
